package club.baimahu.pencil.domain.entity;


import club.baimahu.pencil.domain.entity.account.AccountManager;
import club.baimahu.pencil.domain.entity.account.CashAccount;
import club.baimahu.pencil.domain.entity.account.SimpleAccountManager;

import java.math.BigDecimal;
import java.util.List;

/**
 * 虚拟供应商，能提供任何产品
 */
public class VirtualSupplier extends SimpleAccountManager implements Supplier{


    public VirtualSupplier(){
        super.addAccount(new CashAccount("VirtualSupplierCashAccount",new BigDecimal(1000_0000)));
    }

    @Override
    public boolean hasGoods(String goodsNo) {
        return true;
    }

    @Override
    public Goods getGoods(String goodsNo) {
        return new Goods(goodsNo,null,null,null);
    }

    @Override
    public boolean sell(Goods goods, AccountManager buyerAccountManager) {
        return super.income(goods.getFactoryPrice(),buyerAccountManager);
    }

    @Override
    public List<Goods> supply() {
        return null;
    }

}
